<?xml version="1.0" encoding="UTF-8"?>

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:p="http://primefaces.org/ui"
     xmlns:a="http://xmlns.jcp.org/jsf/passthrough"
     template="../TemplateFrontEnd.xhtml">
<ui:define name="title">Register Now</ui:define>
<ui:define name="body" >
<script>
	function ChangeVisibility()
	{
		
		 if(document.getElementById('j_idt16:j_idt17:UserType_input').value=="Permanent")
			 {
			 
			 document.getElementById('j_idt16:j_idt17:lobjet').style.display = 'block';
			 }
		 else
			 {
			 document.getElementById('j_idt16:j_idt17:lobjet').style.display = 'none';
			 }
	}
	

</script>


<div class="container">


  <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
     
	   
    <p:panel id="basic"   > 
    <h:form>
    <h:panelGrid columns="4" cellpadding="5" style="width:41%;clear: both;margin: auto;">

			<p:commandLink style="color:blue;" ajax="false" value="Proffessional carrier" action="Register.xhtml" />
			<p:commandLink style="color:blue;" ajax="false" value="Private carrier" action="RegisterPriCarrier.xhtml" />
			<p:commandLink style="color:blue;" ajax="false" value="Proffessional shipper" action="RegisterProShipper.xhtml" />
			<p:commandLink style="color:blue;" ajax="false" value="Private shipper" action="#" />
			
     </h:panelGrid> 
         </h:form>
         <h:form>
           <h:panelGrid columns="1" cellpadding="5" style="width:41%;clear: both;margin: auto;">

               <p:outputLabel value="Are you a Private Shipper, Register Now?" />
        
         <br/><br/>
         <p:inputText  id="fName" value="#{inscriptionMB.client.prenom}" />
		<p:watermark for="fName" value="First Name"  />
	
		<p:inputText p:placeholder="Last Name" id="LName" value="#{inscriptionMB.client.nom}" />
		<p:watermark for="LName" value="Last Name"  />
		
			<p:inputText  id="Email" value="#{inscriptionMB.client.email}" />
		<p:watermark for="Email" value="Email"  />
		
				<p:inputText id="Username" value="#{inscriptionMB.client.username}" />
		<p:watermark for="Username" value="Username"  />
		
			<p:inputText  id="Password" value="#{inscriptionMB.client.password}" />
		<p:watermark for="Password" value="Password"  />
		
		<p:inputText p:placeholder="Repeat Password" id="RePassword" value="#{inscriptionMB.passwordRe}"  />
		<p:watermark for="RePassword" value="Repeat Password"  />
		
		
		 <p:selectOneMenu  id="countryu" value="#{inscriptionMB.idC}" style="width:150px"   >
                <p:ajax listener="#{inscriptionMB.onCountryChange(0)}" update="Stateu" />
                <f:selectItem itemLabel=" Country" itemValue="" noSelectionOption="true" />
                <f:selectItems value="#{inscriptionMB.listPays}" var="a" itemValue="#{a.idPays}" itemLabel="#{a.intitule}" />
            </p:selectOneMenu>
          
            
	
	  <p:selectOneMenu id="Stateu" value="#{inscriptionMB.idS}" style="width:150px"  >
               <p:ajax listener="#{inscriptionMB.onStateChange(0)}" update="cityu" />
                 <f:selectItem itemLabel="State" itemValue="" noSelectionOption="true" />
                <f:selectItems value="#{inscriptionMB.listeEtat}"  var="s" itemValue="#{s.idEtat}"  itemLabel="#{s.intitule}"/>
            </p:selectOneMenu>
     
            
          
		  <p:selectOneMenu id="cityu" value="#{inscriptionMB.idCi}" style="width:150px"   >
                <f:selectItem itemLabel="City" itemValue="" noSelectionOption="true" />
                <f:selectItems value="#{inscriptionMB.listeVille}" var="a" itemValue="#{a.idVille}" itemLabel="#{a.intitule}" />
            </p:selectOneMenu>
            
          
		<p:inputText  id="zipcode" value="#{inscriptionMB.client.codePost_usr}" />
		<p:watermark for="zipcode" value="Zipcode"  />
		
		
		
		<p:inputText  id="Street" value="#{inscriptionMB.client.rue_usr}" />
		<p:watermark for="Street" value="Street Address"  />
		
		
		
		<p:inputText  id="Telephone" value="#{inscriptionMB.client.telephone_usr}" />
		<p:watermark for="Telephone" value="Telephone"  />
		
	
		<p:inputText id="Mobile" value="#{inscriptionMB.client.mobile_usr}" />
		<p:watermark for="Mobile" value="Mobile Number"  />
		
		
          
		  <p:selectOneMenu  id="Industry" value="#{inscriptionMB.idIndustry}" style="width:150px"  >
                <f:selectItem itemLabel="Industry Type" itemValue="" noSelectionOption="true" />
                <f:selectItems value="#{inscriptionMB.listeIndustrie()}" var="a" itemValue="#{a.idIndustrie}" itemLabel="#{a.intitule}" />
            </p:selectOneMenu>
     
      
      
     
		<p:outputLabel value="User:" />
		
		 
	   <p:selectOneMenu  id="UserType" value="#{inscriptionMB.userType}" onchange="ChangeVisibility()" style="width:150px"   >
         	   <f:selectItem itemLabel="User Type" itemValue="" noSelectionOption="true" />
               <f:selectItem itemLabel="Temporary User" itemValue="Temporary" />
               <f:selectItem itemLabel="Permanent User" itemValue="Permanent" />
         </p:selectOneMenu>
   
         
         
        <p:panelGrid columns="1" id="lobjet" style="display:none;" >
      
        <p:selectOneMenu value="#{inscriptionMB.idAbonnement}" style="width:150px">
          <f:selectItem itemLabel="Periods" itemValue="" noSelectionOption="true" />
          <f:selectItems value="#{inscriptionMB.listeAbonnement()}" var="a" itemLabel="#{a.nbrPeriode}#{a.periode}" itemValue="#{a.idStaretegie}" />
        </p:selectOneMenu>
        
        </p:panelGrid>
        <p:inputTextarea id="comments"  />
        <p:watermark for="comments" value="Comments"  />
		
		
		
		 <p:selectOneMenu value="#{inscriptionMB.idLangue}" >
		  <f:selectItem itemLabel="Language" itemValue="" noSelectionOption="true" />
           <f:selectItems value="#{inscriptionMB.listeLangauge()}" var="a" itemLabel="#{a.intitule}" itemValue="#{a.id}" />    
		 </p:selectOneMenu> 
		  
		<p:outputLabel  value="I confirm that... " />
       <h:panelGrid columns="2"> <p:selectBooleanCheckbox value="#{inscriptionMB.terme1}" /><h:link style="color:blue;" hreflang="#">I have read  The user terms </h:link>
       <p:selectBooleanCheckbox value="#{inscriptionMB.terme2}" /><h:link style="color:blue;" hreflang="#">I have read  The price list </h:link>
        <p:selectBooleanCheckbox value="#{inscriptionMB.terme3}" /> <h:link style="color:blue;" hreflang="#"> It is my responsibility that those users who operate on my behalf, obey  The user terms </h:link>
           </h:panelGrid>  
           <div class="cap1">
         <p:captcha label="Captcha" id="captcha1" /></div>
            <div class="term1"></div>
        <p:commandButton ajax="false" value="Register" action="#{inscriptionMB.AjouterFrontEnd('Exp','Pri')}" />
        </h:panelGrid>
         </h:form>
    </p:panel>
   
</div>


</ui:define>
</ui:composition>